<template>
	<view>
		<my-custom bgColor="bg-gradual-blue" :isBack="false">
			<block slot="content">我的</block>
		</my-custom>
		<view style="border-style:solid;border-radius: 30px;border: 1px ">
			<image src="/static/img/头像.png" style="width: 80px;height: 70px;margin-top: 25px;
		margin-left: 125px;"></image>
			<view style="text-align: center;margin-bottom: 25px;">
				<h3>{{user.username}}</h3>
				<h5>{{user.phoneNumber}}</h5>
				<h5>权限：管理员</h5>
			</view>
		</view>
		<button  @tap="logout">注销</button>
		<my-component-tabar />
	</view>
</template>

<script>	
	import * as auth from '@/api/auth.js'
	export default {
		data() {
			return {
				user:{}				
			}
		},		
		onShow(option) {
			auth.currentUser().then(res=>{
				console.log(res.data)
				this.user=res.data
			});
		},
		methods: {
			logout() {
				auth.logout();
				//清除token：lifeData
				uni.setStorageSync("lifeData","")
				uni.navigateTo({
					url:"../login/login/index"
				})
			}
		}
	}
</script>

<style>

</style>
